﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace switchpractice
{
    class Program
    {
        /// <summary>
        /// switch学生成绩
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            int level;
            Console.Write("请输入一个学生的成绩：");
            double grade = Convert.ToDouble(Console.ReadLine());
            if (grade < 0 && grade > 100)
            {
                level = 0;
            }
            else if (grade <= 59 && grade >= 0)
            {
                level = 1;
            }
            else if (grade <= 79 && grade >= 60)
            {
                level = 2;
            }
            else if (grade <= 89 && grade >= 80)
            {
                level = 3;
            }
            else
            {
                level = 4;
            }
            switch (level)
            {
                case 0:
                    Console.WriteLine("成绩输入不正确");
                    break;
                case 1:
                    Console.WriteLine("成绩不及格");
                    break;
                case 2:
                    Console.WriteLine("成绩及格");
                    break;
                case 3:
                    Console.WriteLine("成绩良好");
                    break;
                case 4:
                    Console.WriteLine("成绩优秀");
                    break;
            }
            Console.ReadKey();

        }
    }
}
